Repository navigation
GH Issue 1867: Stop multi-row inserts from losing values or defaults when rows differ in keys or key casing - #8313
Closed
labkey-jeckels wants to merge 6 commits into
Closed
labkey-jeckels wants to merge 6 commits into
labkey-jeckels wants to merge 6 commits into
Conversation
…pply DB defaults to omitted columns
…tWithKeys and direct insertRows callers
…ry insert path Replaces the saveRows-only PostgreSQL backfill with a per-row omitted marker honored by the insert statement, so explicit nulls still store NULL.
Contributor
Author
|
Retargeted to release26.11-SNAPSHOT: #8336 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale
This PR stops multi-row inserts and saveRows from silently storing blanks when rows in one request supply different fields or spell a field name in different case (GH Issue 1867). importRows dropped fields the first row left out; a later row spelling a key in different case blanked that field in earlier rows; and on every insert path a row omitting a column another row supplied got NULL instead of the column's database default, all while the request reported success.
Behavior change for reviewers: internal callers that relied on an omitted key meaning NULL in a mixed batch now get the column's database default, which is what a single-row insert, or a batch in which every row omits the column, already does.
Tested with new integration tests in
ImportRowsTestCase, which failed before the fix, plus the collections, data iterator, statement, query update service, list, sample type, data class, lineage and plate server tests against a local PostgreSQL server. SQL Server and the Selenium tests were not run locally.Related Pull Requests
None
Changes